<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8"/>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <base href="<?php echo $system['siteRoot'];?>" />
    <script type="text/javascript">root='<?php echo $system['root'];?>';</script>
    <title>文章管理</title>
    <link rel="stylesheet" href="plugin/awesome/font-awesome.min.css"/>
    <link rel="stylesheet" href="plugin/reset.css"/>
    <link rel="stylesheet" href="style/index.css"/>
    <link rel="stylesheet" href="style/article.css"/>
    <script src="script/index.js"></script>
</head>
<body>
<div class="container">
    <header>
        <div class="banner">
            <a href="<?php e_page("home","index"); ?>"><img class="logo" src="style/image/login-logo.png" alt=""></a>
            <?php import_part("custom.home","loginAndSearch"); ?>
        </div>
    </header>
    <div class="main-container">
        <div class="wrapper">
            <div class="nav">
                <a href="<?php e_action("add",""); ?>">发布文章</a>
                <a href="<?php e_action("article",""); ?>" class="select">文章管理</a>
            </div>
            <div class="article-box">
                <div class="user-information">
                    <?php import_part("custom.dash","userInfo");?>
                </div>
                <div class="article-manage">
                    <div class="article-manage-title">
                        <h3>个人主页/<a>文章管理</a></h3>
                    </div>
                    <div class="article-manage-table">
                        <table>
                            <tr class="table-title">
                                <th class="article-title">文章标题</th>
                                <th class="article-type">所属栏目</th>
                                <th class="article-examine">审核情况</th>
                                <th class="send-time">发布时间</th>
                            </tr>
                        <?php foreach($r['article'] as $i){?>
                            <tr>
                                <td class="article-title"><a href="<?php e_page("article","content","id=".$i['id']);?>"><?=$i['title']?></a></td>
                                <td class="article-type">
                                <?php $ifFirst=true; foreach($i['menu'] as $menuItem):  ?>
                                    <?php if($ifFirst) $ifFirst=false; else echo "/"; ?>
                                    <a href="<?php e_page("article","list","menu_id=".$menuItem['id']) ?>"><?=$menuItem['name']?></a>
                                <?php endforeach; ?>
                                </td>
                                <?php if($i['enable']==1){ ?>
                                <td class="article-examine already-pass"><i class="fa fa-check-circle-o"></i><span>已通过</span></td>
                                <?php }else{ ?>
                                <td class="article-examine no-examine"><i class="fa fa-question-circle"></i><span>未审核</span></td>
                                <?php } ?>
                                <td class="send-time"><i class="fa fa-clock-o"></i><?=date("Y/m/d",strtotime($i['publish_time']))?></td>
                            </tr>
                        <?php } ?>
                        </table>
                    </div>
                    <?=$r['page']?>
                </div>
            </div>
        </div>
    </div>
    <?php import_tpl("fragment/footer.php"); ?>
</div>

</body>
</html>